<template>
    <div>
      <Dropdown trigger="click" style="margin-left: 20px" @on-click="clickVmsType" transfer>
        <Button type="primary">
          接入环境
          <Icon type="ios-arrow-down"></Icon>
        </Button>
        <DropdownMenu slot="list">
            <DropdownItem name="console">console</DropdownItem>
          <DropdownItem v-for="(value,key) in row.accesses" :key="key" :name="value.accessType">{{value.accessType}}</DropdownItem>
        </DropdownMenu>
      </Dropdown>
    </div>
</template>

<script>
	import encryption from '@/libs/encryption.js'
    export default {
        name: "vmsType",
        props: {
          row: Object,
          ecid:String,
          classId:String
        },
        data(){
          return{

          }
        },
        mounted(){
            console.log(this.row)
        },
        methods:{
          clickVmsType(name){
            let vmId = this.row.id;
//          let routeData = this.$router.resolve({
//            path: "/vncPage",
//            query: {
//              ecid:this.ecid,
//              vmid:vmId,
//              vmType:name,
//            }
//          });
//          window.openTrain(routeData.href,'_black')
						let September = sessionStorage.getItem('November')
            September = JSON.parse(encryption.SelfUseDecrypt(September))
						const { href } = this.$router.resolve({
                path:'/testMachine',
                query:{
                    projectId:this.row.projectId,
                    ecid:this.ecid,
                    teacherId:September.userId,	
                    classId:this.classId,
				    vmId:vmId,                    
				    accessType:name
                }
            });
            window.openTrain(href, '_blank')
          }
        }
    }
</script>

<style scoped>

</style>
